UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZQd135PXueH7SnJ5JVUo6yP6vN59k3XO4RXH4V7kOtE='
WHERE
key_id = '7432b5d2bf13955c26e7f22b8e31db701a55a51f31909752d149d7c64779e0ae'
AND (
token = 'ZQd135PXueH7SnJ5JVUo6yP6vN59k3XO4RXH4V7kOtE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)