UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GptisxBHE7D56dZ6JwEvR2oR0sag6wuNaV+WgJYWNuI='
WHERE
key_id = 'ce6920070e619c7e06c03d88b79e33b4b390bd2520b625001f0afba0c5833d4c'
AND (
token = 'GptisxBHE7D56dZ6JwEvR2oR0sag6wuNaV+WgJYWNuI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)