UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Ha3yL9m+ESYJ1hn4efVX5EPm7q9lTz9fwdifFt7Dz2I='
WHERE
key_id = '4097d4cb2eeb1099ebcb776b40ca51892173e606203502b0f5f4c83e7dd632db'
AND (
token = 'Ha3yL9m+ESYJ1hn4efVX5EPm7q9lTz9fwdifFt7Dz2I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)