UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ohBXIBAPWGWXcWAofjYV5rt8IGF+Qllum05xY1eIQqY='
WHERE
key_id = 'ed9ebd23f732e93ef5cd4086b158db950772239041d3377e3f64ff066e82db8f'
AND (
token = 'ohBXIBAPWGWXcWAofjYV5rt8IGF+Qllum05xY1eIQqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)