UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2RLbD6CrLlzneZDhjspcHMbhWrGC+SnoQeXg1ogsFTA='
WHERE
key_id = '0d2348607a337b13798399b4d90f1927df7abc0a2da4dec33360f94522e15edb'
AND (
token = '2RLbD6CrLlzneZDhjspcHMbhWrGC+SnoQeXg1ogsFTA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)