UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'F7++amrpuK3N41pGiEwpdKeJB0sU7qLv3PMT27Q5DRc='
WHERE
key_id = 'ea3f59e8622780d86f33927b28a117a69db6aa4d6f936a2e51d452b61d6006d7'
AND (
token = 'F7++amrpuK3N41pGiEwpdKeJB0sU7qLv3PMT27Q5DRc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)