UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'thXs/zgFmProsJbf3tkrvQe2gI49SNcH6aGN6bKSYvU=' 
WHERE 
  key_id = 'a0f91126f413763d3dd29f0b1839830961d8aae9adf1a6167648759c84f0bd1a' 
  AND (
    token = 'thXs/zgFmProsJbf3tkrvQe2gI49SNcH6aGN6bKSYvU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023