UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'EdM+lE0C4laKrQy1ZAZmtPWtYZ0Q9K6VIv0/vOuSihc='
WHERE
key_id = '8a40956516f442911bd00d0bccc2b708011924a194199a563316b0e7e0373976'
AND (
token = 'EdM+lE0C4laKrQy1ZAZmtPWtYZ0Q9K6VIv0/vOuSihc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)