UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'kNWXuSh4q548HJ2XyMlWNBV/4k+SZpwwLLmKLUWRooI=' 
WHERE 
  key_id = '0193c2857d3830ba6213c6b27941f45a5bbbe89bbf7be6dd4106eaf489d335b3' 
  AND (
    token = 'kNWXuSh4q548HJ2XyMlWNBV/4k+SZpwwLLmKLUWRooI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029