UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'H56HJ3hXZVoZGPXqEatg5vWMdcVZ3wiMa6gWzq1y9oo=' 
WHERE 
  key_id = '8ba3a708ecb56e601d908dccc8e646da217c9a275a4c2ee17dc912545a39bb49' 
  AND (
    token = 'H56HJ3hXZVoZGPXqEatg5vWMdcVZ3wiMa6gWzq1y9oo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00043