UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c0V1fpD/ThprR//cZr6ELRiV+6Gm/nY1kZPWz5cxRCA=' 
WHERE 
  key_id = 'a70960e28098845f0b83b8d6199b19787b55059f6f521a2f35fd2f74ec4bea92' 
  AND (
    token = 'c0V1fpD/ThprR//cZr6ELRiV+6Gm/nY1kZPWz5cxRCA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060