UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wT8qBuhcvjtf0gShUtwaZpjOiI5bI4f5CTYNQ5O561w='
WHERE
key_id = '23294d947e81fc09feb2254cb4a2b4e1bcbd6c7c9116e3e99ee79c2672b18d4a'
AND (
token = 'wT8qBuhcvjtf0gShUtwaZpjOiI5bI4f5CTYNQ5O561w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)