UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XE8MtYPWkOvC9Waal7Yr1SrRsu6cEl+LL+Z6q9Oi3DM='
WHERE
key_id = '7e4eb4b6add50277e28d3e1f7dd17e88a0cbb7e37d3ef2b57bf3c190f305dc15'
AND (
token = 'XE8MtYPWkOvC9Waal7Yr1SrRsu6cEl+LL+Z6q9Oi3DM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)