UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'E/sMVtDXY5KMhJHoQMvfIBzLj+WHKXwSyfVDyjmqyPY='
WHERE
key_id = '38db859f899fc89d24b9741fdd98ee818a72e0aab93fe8b57cc044dce4827563'
AND (
token = 'E/sMVtDXY5KMhJHoQMvfIBzLj+WHKXwSyfVDyjmqyPY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)