UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7Y1nuPBAvBGozVsOL2fln1PwqjCpqXaltrpZUASfLV8='
WHERE
key_id = '719c467636164fa903a641a025514a1528f38bff3b73357b0be9fe50933db9ce'
AND (
token = '7Y1nuPBAvBGozVsOL2fln1PwqjCpqXaltrpZUASfLV8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)