UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hQjL11ywSMuGXDgqbuYlhBPztbHrfPXqN+dAYDGwi88='
WHERE
key_id = '2ce82b143f7622d2be880759808b3843a96d2904c76fa5e4da471c09ab46682f'
AND (
token = 'hQjL11ywSMuGXDgqbuYlhBPztbHrfPXqN+dAYDGwi88='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)