UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'g7jo2Gbvckf6fJit5ZoQu8zmVDa9UuHzinow09xxq7g='
WHERE
key_id = '44e49026278b341161d26428910b10504629b822ac92cca51c37a16495fa011b'
AND (
token = 'g7jo2Gbvckf6fJit5ZoQu8zmVDa9UuHzinow09xxq7g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)