UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'r3MvwrTTk5kAIZAyBRgQ2wFhgie+2U3I6XZ2BvPsNJY='
WHERE
key_id = 'c64df390346cc9922a33e0360771aaf0e58b9aca9179ea7eb96c965de058174c'
AND (
token = 'r3MvwrTTk5kAIZAyBRgQ2wFhgie+2U3I6XZ2BvPsNJY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)