UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'aet1zDWW4DAFjBe5AEWvJ6GIyQ7V3zjMUhOdplYOzZQ='
WHERE
key_id = 'fcb707251e6ca037c568ba40b79ff90c322f3567bc320b7c8cc163c1f4816b44'
AND (
token = 'aet1zDWW4DAFjBe5AEWvJ6GIyQ7V3zjMUhOdplYOzZQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)