UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'eqli+NxgRofpWVrm3tjnYSGjIsg83qkOsUHS7wr5i7c='
WHERE
key_id = '87b10f341bbb7dbee445c67347f55c2745ceb88a6b22e14885c8ce6bc26351fd'
AND (
token = 'eqli+NxgRofpWVrm3tjnYSGjIsg83qkOsUHS7wr5i7c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)