UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '4I7ixjRHEAIBEHegtjFayAcc3L2OXIUxwBaeVaYl1+w=' 
WHERE 
  key_id = '740801ab95f2106adaa59f6c1f03ea86c64cc4864fb94c3c9ae6e8654dbca5f0' 
  AND (
    token = '4I7ixjRHEAIBEHegtjFayAcc3L2OXIUxwBaeVaYl1+w=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00022