UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7P586CivrEI7FtQAZ7QyweBizz2KNtupz1Jus+Ti0x8='
WHERE
key_id = '7bbac71ebb4f3692eb80b44da37e384419b51dc2de68a788b2077ee5647c7a8b'
AND (
token = '7P586CivrEI7FtQAZ7QyweBizz2KNtupz1Jus+Ti0x8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)