UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'g4KTRMAgfzHwz0f+2EU0q1kQKCkbkdGhUh2/q4NtN8g=' 
WHERE 
  key_id = 'ebbf82a8ba65354c2e1f4b9e87cb82ec1396bf208e2983b9f4ad42b561bc96b6' 
  AND (
    token = 'g4KTRMAgfzHwz0f+2EU0q1kQKCkbkdGhUh2/q4NtN8g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00038