UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '3gaUOUWAwHiK/evYDNGUUCR1tvR83bS41Q7jM/zfKEs='
WHERE
key_id = '07ef847f011738ae0a5aa87a82f5a33f136da220a6ac1cc02ecf3cc2954bf942'
AND (
token = '3gaUOUWAwHiK/evYDNGUUCR1tvR83bS41Q7jM/zfKEs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)