UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0U+NZ+V8VF70sRv9GTYRzM/p3SYlJERFS7Y8bhTJOj8='
WHERE
key_id = 'e833846ee27136b442d9da2b824f2bc38277f23d8409f3a36417b18ecd16e961'
AND (
token = '0U+NZ+V8VF70sRv9GTYRzM/p3SYlJERFS7Y8bhTJOj8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)