UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OtIQJQyeGDGJk05NxkihorNZJfFCzvBjWsj0AOnCa3o='
WHERE
key_id = '480036b22706b03c65ec35991817392390714608417233035d9d2f1636b4da84'
AND (
token = 'OtIQJQyeGDGJk05NxkihorNZJfFCzvBjWsj0AOnCa3o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)