UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OSxFGYZUFzJs0CIWbs617ul22KpnLv8QQe/sB2uBLQ4='
WHERE
key_id = '6e3c84020fbcdd557e8247c4dd4ad06fc13cd99192a1e8b0a3493222e5a29f58'
AND (
token = 'OSxFGYZUFzJs0CIWbs617ul22KpnLv8QQe/sB2uBLQ4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)